//分类
var current_city1  = document.querySelector("#current-city1");
var current_city = document.querySelector("#current-city");

//移入分类按钮
current_city1.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    current_city.style.display = "block";

});
current_city1.addEventListener("mouseleave",function(){
    current_city.style.display = "none" ;
});
//移入详情
current_city.addEventListener("mouseover",function(){
    current_city.style.display = "block";
});
//移除详情
current_city.addEventListener("mouseleave",function(){
    current_city.style.display = "none";

});




var u1  = document.querySelector("#u1");
var message_list_header = document.querySelector(".message-list-header");

//移入分类按钮
u1.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    message_list_header.style.display = "block";

});
u1.addEventListener("mouseleave",function(){
    message_list_header.style.display = "none" ;
});
//移入详情
message_list_header.addEventListener("mouseover",function(){
    message_list_header.style.display = "block";
});
//移除详情
message_list_header.addEventListener("mouseleave",function(){
    message_list_header.style.display = "none";
});




var u  = document.querySelector("#u");
var app_list = document.querySelector("#app-list");

//移入分类按钮
u.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    app_list.style.display = "block";

});
u.addEventListener("mouseleave",function(){
    app_list.style.display = "none" ;
});
//移入详情
app_list.addEventListener("mouseover",function(){
    app_list.style.display = "block";
});
//移除详情
app_list.addEventListener("mouseleave",function(){
    app_list.style.display = "none";
});



var nii = document.querySelector("#nii");

//滚动条事件，滚动触发一次，这个事件就会执行一次
window.onscroll = function(){
    console.log(document.documentElement.scrollTop || document.body.scrollTop);

    //判断它距离顶部的位置
    if (document.documentElement.scrollTop > 1000 || document.body.scrollTop >500){
        nii.style.display = "block";
    }else {
        nii.style.display = "none";
    }
};

nii.addEventListener('click',function(){
    //滚动到指定位置
    window.scrollTo(0,0);

    //window.scrollTo({
    //    top1: 0,
    //    behavior:'smoooth'
    //})
});







var e  = document.querySelector("#e");
var app_list1 = document.querySelector("#app-list1");

//移入分类按钮
e.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    app_list1.style.display = "block";

});
e.addEventListener("mouseleave",function(){
    app_list1.style.display = "none" ;
});
//移入详情
app_list1.addEventListener("mouseover",function(){
    app_list1.style.display = "block";
});
//移除详情
app_list1.addEventListener("mouseleave",function(){
    app_list1.style.display = "none";
});


var e1  = document.querySelector("#e1");
var app_list2 = document.querySelector("#app-list2");

//移入分类按钮
e1.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    app_list2.style.display = "block";

});
e1.addEventListener("mouseleave",function(){
    app_list2.style.display = "none" ;
});
//移入详情
app_list2.addEventListener("mouseover",function(){
    app_list2.style.display = "block";
});
//移除详情
app_list2.addEventListener("mouseleave",function(){
    app_list2.style.display = "none";
});




var mySwiper = new Swiper ('.swiper-container', {
    //direction: 'vertical', // 垂直切换选项
    loop: true, // 循环模式选项

    autoplay:true, //自动切换

    // 如果需要分页器
    pagination: {
        el: '.swiper-pagination',
    },

    // 如果需要前进后退按钮
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },

})




//$('.home-menu a').click(function () {
//    $('html, body').animate({
//        scrollTop: $($.attr(this, 'href')).offset().top
//    }, 500);
//    return false;
//});

//$(function(){
//    $('a[href*=#],area[href*=#]').click(function() {
//        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
//            var $target = $(this.hash);
//            $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
//            if ($target.length) {
//                var targetOffset = $target.offset().top;
//                $('html,body').animate({
//                        scrollTop: targetOffset
//                    },
//                    1000);
//                return false;
//            }
//        }
//    });
//})